home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol A-4 / (Vol A-4) Vol. A4.iso / Games / the_fighter_training.swf / scripts / frame_29 / PlaceObject2_503_94 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2008-03-13  |  2KB  |  78 lines

  1. onClipEvent(enterFrame){
  2.    if(this._name != "item_mc")
  3.    {
  4.       if(!hit)
  5.       {
  6.          this._x -= sp;
  7.       }
  8.       else if(this.life > 0)
  9.       {
  10.          this._x = tX;
  11.       }
  12.       else
  13.       {
  14.          this._x += 0.2 * (tX - this._x);
  15.       }
  16.       if(this.hit_mc.hitTest(_parent.char_mc.hit_mc) && !hit)
  17.       {
  18.          hit = true;
  19.          this.life--;
  20.          if(this.life > 0)
  21.          {
  22.             _parent.hit1_sound.start();
  23.             tX = this._x + hitDist2;
  24.          }
  25.          else
  26.          {
  27.             _parent.hit2_sound.start();
  28.             if(itemNum < 3)
  29.             {
  30.                tX = this._x + hitDist0;
  31.             }
  32.             else
  33.             {
  34.                tX = this._x + hitDist1;
  35.             }
  36.             var point = _parent.point_array[itemNum];
  37.             _parent.score += point;
  38.             _parent.setMeter(_parent.score_mc,_parent.score);
  39.          }
  40.          this.item.play();
  41.       }
  42.       if(this._x < limitX && !hit)
  43.       {
  44.          if(_parent.char_mc.char_mode != "down")
  45.          {
  46.             if(_parent.char_mc.char_mode == "away")
  47.             {
  48.                if(itemNum < 3)
  49.                {
  50.                   _parent.ctrlEnergy(-10);
  51.                }
  52.                else
  53.                {
  54.                   _parent.ctrlEnergy(-15);
  55.                }
  56.                if(_parent.energy_mc._currentframe == 100)
  57.                {
  58.                   _parent.charDown();
  59.                }
  60.             }
  61.             else
  62.             {
  63.                if(itemNum < 3)
  64.                {
  65.                   _parent.ctrlEnergy(-20);
  66.                }
  67.                else
  68.                {
  69.                   _parent.ctrlEnergy(-30);
  70.                }
  71.                _parent.charDown();
  72.             }
  73.          }
  74.          _parent.removeItem(this);
  75.       }
  76.    }
  77. }
  78.